package com.yu.crm.domain.pojo;

import com.alibaba.fastjson.annotation.JSONType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import javax.validation.constraints.NotEmpty;

import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 角色分组表
 * </p>
 *
 * @author donnie-bin
 * @since 2019-06-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@JSONType(orders = {"id"})
public class CrmRoleGroup implements Serializable {


    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键", required = false)
    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;

    @ApiModelProperty(value = "上级角色分组ID", required = false)
    @TableField("pid")
    private Long pid;

    @ApiModelProperty(value = "分组名称", required = true)
    @NotEmpty(message = "分组名称不能为空")
    @TableField("role_group_name")
    private String roleGroupName;

    @ApiModelProperty(value = "分组描述", required = false)
    @TableField("role_group_description")
    private String roleGroupDescription;

    @ApiModelProperty(value = "创建时间", required = false)
    @TableField("gmt_create")
    private LocalDateTime gmtCreate;

    @ApiModelProperty(value = "修改时间", required = false)
    @TableField("gmt_modified")
    private LocalDateTime gmtModified;

    @ApiModelProperty(value = "是否已删除 yes_no", required = false)
    @TableField("is_deleted")
    @TableLogic
    private Integer isDeleted;


    /*-------------add--------------*/
    @ApiModelProperty(value = "角色列表", required = false)
    @TableField(exist = false)
    private List<CrmRole> roleList;

    @ApiModelProperty(value = "子节点列表", required = false)
    @TableField(exist = false)
    private List<CrmRoleGroup> children;
}
